/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sda.levelup.calculator;

import sda.levelup.calculator.model.UserAction;

/**
 *
 * @author user
 */
public class Processor
{
    public double calc(UserAction ua){
        double first = ua.getFirstArg();
        double second = ua.getSecondArg();
        double result=0;
        if(ua.getOperation()=='+'){
            result = first+second;
        }
        if(ua.getOperation()=='-'){
            result = first-second;
        }
        if(ua.getOperation()=='*'){
            result = first*second;
        }
        if(ua.getOperation()=='/'){
            result = first/second;
        }
        ua.setResult(result);
        return result;
    }
}
